JavaScript is a prototype-based, object-oriented scripting language that is dynamic, weakly typed, and has first-class functions. It is an implementation of the ECMAScript language standard and is primarily used as a client-side scripting language. For web-based applications, JavaScript is often used to provide enhanced user interfaces and dynamic websites, enabling programmatic access to computational objects within a host environment. It is an interpretive language. Instead of compiling the source code of a software program written in JavaScript into machine code for execution, the software program is indirectly executed (i.e., interpreted) by a JavaScript interpreter program. That is, the JavaScript interpreter interprets the JavaScript source code of the software program. Almost all web browsers currently support the capability of interpreting source code written in JavaScript.
The JavaScript language has some noticeable features. For example, JavaScript supports structured programming syntax, such as “if” statements, “while” loops, “switch” statements, and function-level scoping. JavaScript 1.7 also supports block-level scoping with the “let” keyword. It makes a distinction between expressions and statements. With JavaScript, types are associated with values, not with variables (i.e., dynamic typing). For example, a variable can be bound to a number at first and later rebound to a string. JavaScript is almost entirely object-based. Object properties and their values can be added, changed, or deleted at run-time. Functions are first-class and are objects themselves.